﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MFTool
{
    public class Eval
    {
        private static Microsoft.JScript.Vsa.VsaEngine Engine = Microsoft.JScript.Vsa.VsaEngine.CreateEngine();

        public static bool EvalJScript(string JScript, out bool bResult)
        {
            bResult = false;
            try
            {
                bResult = System.Convert.ToBoolean(Microsoft.JScript.Eval.JScriptEvaluate(JScript, Engine));
            }
            catch (Exception ex)
            {
                return false;
            }
            return true;
        }
    }
}
